<template>
	<el-container>
		<el-header>
			<div class="left-panel"></div>
			<div class="right-panel">
				<div class="right-panel-search">
				</div>
			</div>
		</el-header>
		<el-main class="nopadding">
			<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange"  show-summary>
				<el-table-column type="selection" width="50" align="center" reserve-selection></el-table-column>
				<el-table-column label="商品名称" prop="goods.goods_name" align="center"></el-table-column>
				<el-table-column label="商品类别" prop="goods.cate.cate_name" align="center"></el-table-column>
				<el-table-column label="当前库存" prop="curr_stock" align="center"></el-table-column>
				<el-table-column label="最新进价" prop="goods.cost_price" align="center"></el-table-column>
                <el-table-column v-for="(item,index) in month_data" :key="index" :label="item.value" align="center">
                    <template #default="scope">
                        {{scope.row.month_data[index].number}}
                    </template>
                </el-table-column>
                <el-table-column label="货运方式" type="expand" prop="modo" align="center" width="100">
                    <template #default="props">
                        <div m="4">
                            <scTable :data="props.row.purchase_data" hidePagination hideDo border>
                                <el-table-column fixed="right" label="方式" prop="month" width="150">
                                    <template #default="scope">
                                        <el-tag v-if="scope.row.purchase.modo==1">空运</el-tag>
                                        <el-tag v-if="scope.row.purchase.modo==2">海运</el-tag>
                                    </template>
                                </el-table-column>
                                <el-table-column fixed="right" label="数量" prop="number" width="150" />
                            </scTable>
                        </div>
                    </template>
                </el-table-column>
			</scTable>
		</el-main>
	</el-container>
</template>

<script>

	export default {
		name: 'dept',
		components: {
		},
		data() {
			return {
				dialog: {
					save: false
				},
				apiObj: this.$API.table.stocknumber,
				selection: [],
				search: {},
                month_data: [],
			}
		},
        mounted() {
            this.getMonth()
        },
		methods: {
			upsearch(){
				this.$refs.table.upData(this.search)
			},
            async getMonth() {
                var res = await this.$API.table.stocknumberhead.get();
                this.month_data = res.data;
            },
		}
	}
</script>

<style>
</style>
